﻿@using AwesomeSlider.Models;
@using Orchard.ContentManagement;
@using Orchard.Mvc.Html;
@using Orchard.Utility.Extensions;
@using AwesomeSlider.Extensions;

@{
    Style.Require("SliderAdmin");
    ContentItem contentItem = Model.ContentItem;
    SliderItemPart sliderItem = contentItem.Get(typeof(SliderItemPart)) as SliderItemPart;
}
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
    <div class="thumb-column">
        @Html.Image(Url.Thumb(sliderItem.Id, 90, 90), sliderItem.Name, null)
    </div>
    <div class="properties">
        <h3>@Model.Title</h3>
        @if (Model.Header != null) {
        <div class="header">@Display(Model.Header)</div>
        }
        @if (Model.Meta != null) {
            <div class="metadata">@Display(Model.Meta)</div>
        }
    </div>
    <div class="related">
        <a href="@Url.SliderItemEdit(sliderItem)" title="@T("Edit")">@T("Edit")</a> |
        @if (!sliderItem.HasPublished())
        {
            <text>                 
                @Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = sliderItem.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "PublishUrl UnsafeUrl" })
                 |               
            </text>            
        }
        else
        {
            <text> 
                @Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new { area = "Contents", id = sliderItem.ContentItem.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnpublishUrl UnsafeUrl" })
                 | 
                @Html.ItemDisplayLink(T("View").Text, contentItem) |
            </text>
        }
        
        <a class="remove-photo" href="@Url.SliderItemRemove(contentItem.Id, false)" title="@T("Remove")">@T("Remove")</a>
        <div class="remove-photo-panel" style="display:none;">
            <a href="@Url.SliderItemRemove(contentItem.Id, false)" itemprop="RemoveUrl UnsafeUrl" title="@T("Remove slider Item")">@T("Remove slider Item")</a> 
            <a href="@Url.SliderItemRemove(contentItem.Id, true)" itemprop="RemoveUrl UnsafeUrl" title="@T("Remove slider Item and file")">@T("Remove slider Item and file")</a>    
        </div>
    </div>
</div>


